package com.shop.mms_client.viewmodel;

import android.app.Application;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import com.shop.mms_client.model.BlacklistItem;
import com.shop.mms_client.repository.BlacklistRepository;
import java.util.List;

public class BlacklistViewModel extends AndroidViewModel {
    private final BlacklistRepository repository;

    public BlacklistViewModel(Application application) {
        super(application);
        repository = BlacklistRepository.getInstance(application);
    }

    public LiveData<List<BlacklistItem>> getBlacklistItems() {
        return repository.getAllItems();
    }

    public void addBlacklistItem(BlacklistItem item) {
        repository.insert(item);
    }

    public void deleteBlacklistItem(BlacklistItem item) {
        repository.delete(item);
    }
} 